package com.hhf.job.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class TestTask {
    public String execute() throws InterruptedException {
        log.info("this is execute method,线程名称："+Thread.currentThread().getName()
                + " 线程id："+Thread.currentThread().getId());
        log.info("睡眠中...");
        Thread.sleep(5000);
        log.info("任务执行完毕");
//        throw new RuntimeException("主动抛出一个运行时异常");
        return "success";
    }
    public void outInfo(String a, String b, String c) {
        log.info(a+","+b+","+c);
        log.info("this is outInfo method!线程名称："+Thread.currentThread().getName()
                + " 线程id："+Thread.currentThread().getId());
    }
    public String execute2() throws InterruptedException {
        log.info("this is execute method,线程名称："+Thread.currentThread().getName()
                + " 线程id："+Thread.currentThread().getId());
        log.info("睡眠中...");
        Thread.sleep(60000);
        log.info("任务执行完毕");
//        throw new RuntimeException("主动抛出一个运行时异常");
        return "success";
    }
    public String execute3() throws InterruptedException {
        log.info("this is execute method,线程名称："+Thread.currentThread().getName()
                + " 线程id："+Thread.currentThread().getId());
        log.info("睡眠中...");
        Thread.sleep(60000);
        log.info("任务执行完毕");
//        throw new RuntimeException("主动抛出一个运行时异常");
        return "success";
    }
    public String execute4() throws InterruptedException {
        log.info("this is execute method,线程名称："+Thread.currentThread().getName()
                + " 线程id："+Thread.currentThread().getId());
        log.info("睡眠中...");
        Thread.sleep(60000);
        log.info("任务执行完毕");
//        throw new RuntimeException("主动抛出一个运行时异常");
        return "success";
    }
    public String execute5() throws InterruptedException {
        log.info("this is execute method,线程名称："+Thread.currentThread().getName()
                + " 线程id："+Thread.currentThread().getId());
        log.info("睡眠中...");
        Thread.sleep(60000);
        log.info("任务执行完毕");
//        throw new RuntimeException("主动抛出一个运行时异常");
        return "success";
    }
}
